package com.hudongwx.food.activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import com.hudongwx.food.R;

public class RegisterActivity extends AppCompatActivity {
private TextView login;
    private Intent intent;
    private ImageView img;
    private Button btn;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        login = (TextView) findViewById(R.id.register_login);
        img = (ImageView) findViewById(R.id.register_img);
        btn = (Button) findViewById(R.id.register_btn);
        btn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                intent = new Intent();
                intent.setClass(RegisterActivity.this,ShoaXingActivity.class);
                RegisterActivity.this.startActivity(intent);
            }
        });
        img.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        login.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (null==intent){
                    intent = new Intent();
                    intent.setClass(RegisterActivity.this,LoginActivity.class);
                    RegisterActivity.this.startActivity(intent);
                }
            }
        });
    }

}
